#define MaxSize 50
typedef struct{
    int data[MaxSize];
    int front,rear;
}SqQueue;
bool EnQueue(SqQueue Q,int x){
    if((Q.rear++)%MaxSize==Q.front)
        return false;
    Q.data[Q.rear]=x;
    Q.rear=(Q.rear+1)%MaxSize;
    return true;
}
bool DeQueue(SqQueue Q,int &x){
    if(Q.front==Q.rear)
        return false;
    x=Q.data[Q.front];
    Q.front=(Q.front+1)%MaxSize;
    return true;
}